<!-- 职员列表 -->
<extend name="Public:layout" />
<block name="title"><{$authName}></block>

<block name="pluginCSS">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/select2/select2-metronic.css"/>
<link rel="stylesheet" href="__PUBLIC__/Admin/plugins/data-tables/DT_bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.css"/>
</block>
<block name="CSS"></block>


<block name="loadJS">
<script src="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/data-tables/fnReloadAjax.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/data-tables/DT_bootstrap.js"></script>
<script src="__PUBLIC__/admin/scripts/layer/layer.js" type="text/javascript"></script>	

<script src="__PUBLIC__/admin/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
</block>
<block name="setJS">
<script src="__PUBLIC__/Admin/scripts/custom/tableManager.js"></script>
<script src="__PUBLIC__/Admin/scripts/custom/validateManager.js"></script>
<script>
var ajaxUrl="<{:U('index')}>";
var managerId="<{$Think.session.managerId}>";
function callback(message,status)  {  
	if(status==1)  {  
		layer.msg(message, 
			{icon: 1,time: 2000},
			function(){
				$('#responsive').modal('hide');
				$('#responsive form')[0].reset();
				oTable.fnReloadAjax();
			}
		);   
	}  else{  
		layer.msg(message, 
			{icon: 2,time: 2000}
		);   
		
	}  
}  
</script>
</block>
<block name="initJS">
TableManager.init();
ValidateManager.init();
</block>

<block name="pagetitle">职员的增删改查</block>
<block name="page">

<div class="row">
	<div class="col-md-12">

		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa <{$authIco}>"></i><{$authName}>
				</div>
				
				<div class="actions">
					<a class="btn default green-stripe" id="table_manager_new" data-toggle="modal" href="#">
						<i class="fa fa-plus"></i>
						<span class="hidden-480">添加职员</span>
					</a>
				</div>
				
			</div>
			<div class="portlet-body">
				<table class="table table-striped table-hover table-bordered" id="table_manager">
				</table>
			</div>
		</div>
	</div>
</div>

<div id="responsive" class="modal fade bs-modal-lg" tabindex="-1" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<form class="manager-form" action="<{:U('index')}>" method="post" target="ajax" enctype="multipart/form-data">
		<iframe style="display:none" name='ajax' id="ajax" ></iframe>
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
				<h4 class="modal-title">添加新职员</h4>
			</div>
			<div class="modal-body">
				<div class="scroller" style="height:400px" data-always-visible="1" data-rail-visible1="1">
					<div class="row">
							<input type="hidden" name="noAjax" value="">
							<input type="hidden" name="managerId" value="">
							<div class="form-body">
								<div class="col-md-6">	
									<div class="form-group">
										<label for="loginName">用户名</label>
										<div class="input-icon">
											<i class="fa fa-user"></i>
											<input class="form-control" id="loginName" placeholder="用户名" type="text" name="loginName">
										</div>
									</div>
									
									<div class="form-group">
										<label for="loginPwd">密码</label>
										
										<div class="input-icon">
											<i class="fa fa-lock"></i>
											<input class="form-control" id="loginPwd" placeholder="密码" type="password" name="loginPwd">
										</div>
										
									</div>
									<div class="form-group">
										
										<div class="input-icon right">
											<i class="fa fa-lock"></i>
											<input class="form-control"  id="reLoginPwd" placeholder="确认密码" type="password" name="reLoginPwd">
										</div>
									</div>
									
									<div class="form-group">
										<label>角色</label>
										<select class="form-control" name="managerRoleId">
											<foreach name="roles" item="val" key="key">
											<option value="<{$val['roleId']}>"><{$val['roleName']}></option>
											</foreach>
										</select>
									</div>
									
									
									<div class="form-group">
										<label>账号状态</label>
										<div class="checkbox-list">
											<label class="checkbox-inline">
											<input id="inlineCheckbox1" value="1" type="checkbox" name="workStatus" checked /> 是否在职 </label>
											<label class="checkbox-inline">
											<input id="inlineCheckbox2" value="1" type="checkbox" name="managerStatus" checked /> 是否启用 </label>
										</div>
										
									</div>
											
								</div>
								<div class="col-md-6">
									
									<div class="form-group">
										<label for="managerName">姓名</label>
										<input class="form-control" id="managerName" placeholder="姓名" type="text" name="managerName">
									</div>
									<div class="form-group">
										<label for="managerNo">编号</label>
										<input class="form-control" id="managerNo" placeholder="编号" type="text" name="managerNo">
									</div>
									<div class="form-group">
										<label>头像</label>
										<div>
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
													<!-- <img src="http://www.placehold.it/200x200/EFEFEF/AAAAAA&amp;text=无头像" alt=""/> -->
													<img src="__UPLOAD__/avatar/avatar_m.jpg"/>
												</div>
												<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">
												</div>
												<div>
													<span class="btn default btn-file">
														<span class="fileinput-new">
															 选择图片
														</span>
														<span class="fileinput-exists">
															 更改图片
														</span>
														<input type="file" name="managerPhoto" id="managerPhoto">
													</span>
													<a href="#" class="btn default fileinput-exists" data-dismiss="fileinput">
														 删除图片
													</a>
												</div>
											</div>
										</div>
									</div>	
									
								</div>
							</div>
						
					</div>
				</div>
			</div>
			<div class="modal-footer">
				
				<button type="button" data-dismiss="modal" class="btn default">取消</button>
				<button type="submit" class="btn green">保存</button>
			</div>
		</div>
		</form>
	</div>
	
</div>
</block>